﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Oliving.FormCommon.Oliving.Common
{
    public static class FrmHelper
    {
        public static Control FindControl(Control control, string controlName)
        {
            if (control.Name == controlName)
            {
                return control;
            }
            foreach (Control ctrl in control.Controls)
            {
                Control found = FindControl(ctrl, controlName);
                if (found != null)
                {
                    return found;
                }
            }
            return null;
        }
    }
}
